package com.elong.spring.aspectj.example;

import org.springframework.aop.aspectj.annotation.AspectJProxyFactory;

import com.elong.spring.advice.NaiveWaiter;
import com.elong.spring.advice.Waiter;
import com.elong.spring.aspectj.PreGreetingAspect;

public class AspectJProxyTest {

    public static void main(String[] args) {
	Waiter target = new NaiveWaiter();
	AspectJProxyFactory factory = new AspectJProxyFactory();
	
	factory.setTarget(target);
	
	factory.addAspect(PreGreetingAspect.class);
	
	Waiter proxy = factory.getProxy();
	
	proxy.greetTo("John");
	proxy.serveTo("John");
    }
    
    
}
